package com.xiu.concurrency;

import java.util.concurrent.TimeUnit;

class ADaemon implements Runnable {

	@Override
	public void run() {
		try {
			System.out.println("starting ADaemon");
			TimeUnit.SECONDS.sleep(3);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}finally{
			System.out.println("this should always run?");
		}
	}

}

public class DaemonsDontRunFinally {

	public static void main(String[] args) {
		Thread t = new Thread(new ADaemon());
//		t.setDaemon(true);
		t.start();
		
	}

}
